/**
 * Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.redeemcode.entity;

import com.jeeplus.modules.member.entity.Member;
import javax.validation.constraints.NotNull;
import com.jeeplus.modules.topic.entity.Topic;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeeplus.core.persistence.DataEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;
import lombok.Data;

/**
 * 兑换码Entity
 * @author zhych
 * @version 2021-08-23
 */
@Data
public class RedeemCode extends DataEntity<RedeemCode> {
	
	private static final long serialVersionUID = 1L;
    @NotNull(message="用户不能为空")
	@ExcelField(title="用户", fieldType=Member.class, value="u.nickname", align=2, sort=1)
	private Member u;		// 用户
	@ExcelField(title="兑换码", align=2, sort=2)
	private String code;		// 兑换码
	@ExcelField(title="人数", align=2, sort=3)
	private Integer quantity;		// 数量
	@ExcelField(title="票种", align=2, sort=4)
	private String ticketTypeId;		// 票种
	@ExcelField(title="兑换状态", dictType="yes_no", align=2, sort=5)
	private String redeemState;		// 兑换状态
    @NotNull(message="主题不能为空")
	@ExcelField(title="主题", fieldType=Topic.class, value="topic.title", align=2, sort=6)
	private Topic topic;		// 主题
//	@ExcelField(title="主题名称", align=2, sort=7)
	private String topicTitle;		// 主题名称
    @JsonFormat(pattern = "yyyy-MM-dd")
    @NotNull(message="兑换时间不能为空")
	@ExcelField(title="兑换时间", align=2, sort=8)
	private Date convertDate;		// 兑换时间

	@ExcelField(title="渠道", align=2, sort=8)
	private String remark; // 备注

	private Integer count;

	private String orderId;
	
	public RedeemCode() {
		super();
	}
	
	public RedeemCode(String id){
		super(id);
	}
}